package world.liuru.poem.service.impl;

import org.springframework.stereotype.Service;
import world.liuru.poem.entity.Poem;
import world.liuru.poem.entity.PoemExtendInfo;
import world.liuru.poem.service.PoemExtendService;
import world.liuru.poem.service.PoemExtendVoService;
import world.liuru.poem.service.PoemService;
import world.liuru.poem.vo.PoemExtendVo;
import javax.annotation.Resource;
@Service
public class PoemExtendVoServiceImpl implements PoemExtendVoService {
    @Resource
    PoemService poemService;
    @Resource
    PoemExtendService poemExtendService;
    @Override
    public PoemExtendVo getPoemExtendVo(String id) {
        Poem poem = poemService.findPoemById(id);
        PoemExtendInfo poemExtendInfo = poemExtendService.findPoemExtendByPoemId(id);
        PoemExtendVo poemExtendVo = new PoemExtendVo();
        poemExtendVo.setPoem(poem);
        poemExtendVo.setPoemExtendInfo(poemExtendInfo);
        return poemExtendVo;
    }

}
